home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C / Applications / MacWT 0.9 / wt Source / table.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-10-10  |  1.1 KB  |  42 lines  |  [TEXT/CWIE]

  1. /*
  2. **  MacWT -- a 3d game engine for the Macintosh
  3. **  © 1995, Bill Hayden and Nikol Software
  4. **  Free for non-commercial use - address questions to the e-mail address below
  5. **
  6. **  Mail:           afn28988@freenet.ufl.edu (Bill Hayden)
  7. **    MacWT FTP site: ftp.circa.ufl.edu/pub/software/ufmug/mirrors/LocalSW/Hayden/
  8. **  WWW Page:       http://grove.ufl.edu:80/~nikolsw
  9. **
  10. **    All of the above addresses are due to changes sometime in 1996, so stay tuned
  11. **
  12. **  based on wt, by Chris Laurel
  13. **
  14. **  This program is distributed in the hope that it will be useful,
  15. **  but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. **  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  17. */
  18.  
  19.  
  20.  
  21. #ifndef TABLE_H_
  22. #define TABLE_H_
  23.  
  24. #include <stdlib.h>
  25.  
  26. typedef struct {
  27.      Boolean fixed_size;
  28.      size_t entry_size;
  29.      short current_entries;
  30.      short max_entries;
  31.      void *table;
  32. } Table;
  33.  
  34.  
  35. #define TABLE_ELEMENTS(t, type)   ((type *) (t)->table)
  36. #define TABLE_SIZE(t)             ((t)->current_entries)
  37.  
  38. extern Table *new_table(size_t entry_size, short table_size);
  39. extern short add_table_entry(Table *t, void *entry);
  40.  
  41. #endif
  42.